package demo1;

abstract class Shape {
//    public String name;
//    public int age;
//    public static void func(){
//
//    }
    public abstract void draw();
}

class Rect extends Shape{
    public void draw(){
        System.out.println("画一个矩形！");
    }
}

class Cycle extends Shape {
    @Override
    public void draw() {
        System.out.println("画一个圆圈");
    }
}

class Triangle extends Shape {
    @Override
    public void draw() {
        System.out.println("画一个三角形");
    }
}

public class Test {

    public static void drawMap(Shape shape) {
        shape.draw();
    }

    public static void main(String[] args) {
//        Shape shape=new Shape() ;
        drawMap(new Triangle());
        drawMap(new Cycle());
        drawMap(new Rect());
    }
}
